"""
任务状态查询接口模块
"""

from flask import Blueprint, jsonify
from datetime import datetime

bp = Blueprint('status', __name__, url_prefix='/api')

@bp.route('/status/<task_id>', methods=['GET'])
def get_task_status(task_id):
    """
    查询任务状态接口
    """
    try:
        response = {
            "success": True,
            "data": {
                "task_id": task_id,
                "status": "pending",
                "progress": 0,
                "current_step": "等待处理",
                "quality_score": None,
                "estimated_time_remaining": None,
                "steps": []
            },
            "timestamp": datetime.utcnow().isoformat()
        }
        
        return jsonify(response)
        
    except Exception as e:
        return jsonify({
            "success": False,
            "message": "查询任务状态失败",
            "error_code": "STATUS_QUERY_ERROR",
            "details": str(e),
            "timestamp": datetime.utcnow().isoformat()
        }), 500